import { createRouter, createWebHistory } from 'vue-router'
import HomePage from '@/views/HomePage.vue'
import VideoContribute from '@/views/VideoContribute.vue'
import VideoDetail from '@/views/VideoDetail.vue'
import MessageCenter from '@/views/MessageCenter.vue'
import AtMe from '@/views/message_router_view/@Me.vue'
import MessageSetting from '@/views/message_router_view/MessageSetting.vue'
import MyMessage from '@/views/message_router_view/MyMessage.vue'
import ReceiveLiked from '@/views/message_router_view/ReceiveLiked.vue'
import ReplyMe from '@/views/message_router_view/ReplyMe.vue'
import SystemInform from '@/views/message_router_view/SystemInform.vue'

const routes = [
  {
    path: '/',
    redirect: '/homePage'  // 重定向到登录页
  },
  {
    path: '/homePage',
    name: 'HomePage',
    component: HomePage,
    meta: { requiresAuth: false }
  },
  {
    path: '/videoContribute',
    name: 'videoContribute',
    component: VideoContribute,
    meta: { requiresAuth: false }
  },
  {
    path: '/videoDetail/:id',
    name: 'videoDetail',
    component: VideoDetail,
    meta: { requiresAuth: false }
  },
  {
    path: '/messageCenter',
    meta: { requiresAuth: true },
    component: MessageCenter,
    children: [
      {
        path: '',
        redirect: { name: 'MyMessage' }
      },
      {
        path: 'myMessage',
        name: 'MyMessage',
        component: MyMessage,
        meta: { title: '我的消息' }
      },
      {
        path: 'replyMe',
        name: 'ReplyMe',
        component: ReplyMe,
        meta: { title: '回复我的' }
      },
      {
        path: 'atMe',
        name: 'AtMe',
        component: AtMe,
        meta: { title: '@ 我的' }
      },
      {
        path: 'receiveLiked',
        name: 'ReceiveLiked',
        component: ReceiveLiked,
        meta: { title: '收到的赞' }
      },
      {
        path: 'systemInform',
        name: 'SystemInform',
        component: SystemInform,
        meta: { title: '系统通知' }

      },
      {
        path: 'messageSetting',
        name: 'MessageSetting',
        component: MessageSetting,
        meta: { title: '消息设置' }
      }
    ]
  }
]
const router = createRouter({
  history: createWebHistory(),
  routes
})




export default router
